<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>cross domain</title>
     <script>
        window.addEventListener('message', function(e) {
           if (e.data) 
              document.getElementById('app').innerHTML = e.data;
              localStorage.setItem('setVal1',e.data);
        });
    </script>
</head>
<body>
    <div>通过http://localhost:8081，B域名下获取locahost:8080域名页面存储下来的localStorage值</div>
    <div id="app"></div>
    <iframe hidden=true src="http://localhost:8080/local-storage/index.html"></iframe>
</body>
</html>